<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>

    /* 1vw = 1/100 视口宽度 */
    /* 1vh = 1/100 视口高度 */

    .box {
      box-sizing: border-box;
      /* 一般只用 vw，不混用vw和vh */
      height: 50vw;
      width: 50vw;
      background-color: pink;
    }
  </style>

</head>

<body>
  <div class="box">
  </div>
</body>

</html>